import type { Wallet } from '../../../types/Wallet'
import { type WaypointProviderOpts, type PopupAuthorizeOpts } from '@sky-mavis/waypoint'
import { getRoninWaypointConnector } from '../../getRoninWaypointConnector'
import { roninWaypointIcon } from './roninWaypointIcon'
export type RoninWaypointWalletConfig = {
  config: WaypointProviderOpts
  auth: PopupAuthorizeOpts
}

export const roninWaypointWallet = (roninWaypointWalletConfig: RoninWaypointWalletConfig): (() => Wallet) => {
  // 三方连接器不要设置install属性
  return () => ({
    id: 'roninWaypoint',
    name: 'Ronin Waypoint',
    iconUrl: roninWaypointIcon,
    iconBackground: '#fff',
    createConnector: getRoninWaypointConnector(roninWaypointWalletConfig)
  })
}
